import java.util.*;
class People{
    String name;
    int age;
    public People(String name, int age) {
        super();
        this.name = name;
        this.age = age;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }
    @Override
    public String toString() {
        return "People [name=" + name + ", age=" + age + "]";
    }
}
public class Main {
    public static void main(String args[]) {
        Map<String,People> peoples = new HashMap<String,People>();
        peoples.put("rose", new People("rose",18));
        peoples.put("hunifu", new People("hunifu",19));
        peoples.put("hunifu", new People("britsh",20));
        if( peoples.size() > 0) {//@@正确判断 Map 元素个数
            Scanner sc=new Scanner(System.in);
            String key=sc.next();
            if(peoples.containsKey(key) )//@@判断关键字是否存在 Map 内
                System.out.println(peoples.get(key));//@@取出关键字指定元素
            else
                System.out.println("映射中不存在 key ="+key+" 的元素");
        }
    }
}